<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>2427：[HAOI2010]软件安装</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[HAOI2010]软件安装</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[HAOI2010]软件安装</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                [HAOI2010]软件安装                </h1>
                <p>时间限制：10s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：128MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><p><b style="mso-bidi-font-weight:normal"><span lang="RU" style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;
color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">现在我们的手头有</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">N</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">个软件，对于一个软件</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">i</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">，它要占用</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">W<sub>i</sub></span><span lang="RU" style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">的磁盘空间，它的价值为</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">V<sub>i</sub></span><span lang="RU" style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">。我们希望从中选择一些软件安装到一台磁盘容量为</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">M</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">计算机上，使得这些软件的价值尽可能大（即</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">V<sub>i</sub></span><span lang="RU" style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">的和最大）。</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA"><br />
<br />
</span><span lang="RU" style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">但是现在有个问题：软件之间存在依赖关系，即软件</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">i</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">只有在安装了软件</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">j</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">（包括软件</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">j</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">的直接或间接依赖）的情况下才能正确工作（软件</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">i</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">依赖软件</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">j)</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">。幸运的是，一个软件最多依赖另外一个软件。如果一个软件不能正常工作，那么它能够发挥的作用为</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">0</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">。</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA"><br />
<br />
</span><span lang="RU" style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">我们现在知道了软件之间的依赖关系：软件</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">i</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">依赖软件</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">D<sub>i</sub></span><span lang="RU" style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">。现在请你设计出一种方案，安装价值尽量大的软件。一个软件只能被安装一次，如果一个软件没有依赖则</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">D<sub>i</sub>=0</span><span lang="RU" style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">，这时只要这个软件安装了，它就能正常工作。</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA"><br style="mso-special-character:line-break" />
<br style="mso-special-character:line-break" />
</span></b></p>
<p></p></p><hr/><h3>输入格式</h3><p><p><b style="mso-bidi-font-weight:normal"><span lang="RU" style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;
color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">第</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">1</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">行：</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">N, M</span><span lang="RU" style="font-size:12.0pt;
font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:宋体;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA"> </span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA"><span style="mso-spacerun:yes">&nbsp;</span></span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;
color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">（</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">0&lt;=N&lt;=100, 0&lt;=M&lt;=500</span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;
color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">）</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA"><br />
</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;
mso-fareast-font-family:宋体;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:ZH-CN;
mso-bidi-language:AR-SA"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span lang="RU" style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;
color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">第</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">2</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">行：</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">W<sub>1</sub>, W<sub>2</sub>, ... W<sub>i</sub>, ..., W<sub>n</sub> </span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:ZH-CN;
mso-bidi-language:AR-SA">（</span><span lang="RU" style="font-size:12.0pt;
font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:&quot;Times New Roman&quot;;
color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">0&lt;=W<sub>i</sub>&lt;=M</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
宋体;color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA"> </span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;
color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">）</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA"><br />
</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;
mso-fareast-font-family:宋体;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:ZH-CN;
mso-bidi-language:AR-SA"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span lang="RU" style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;
color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">第</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">3</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">行：</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">V<sub>1</sub>, V<sub>2</sub>, ..., V<sub>i</sub>, ..., V<sub>n</sub> </span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;
mso-fareast-font-family:宋体;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:ZH-CN;
mso-bidi-language:AR-SA"><span style="mso-spacerun:yes">&nbsp;</span></span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;
color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">（</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">0&lt;=Vi&lt;=1000</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
宋体;color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA"> </span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;
color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">）</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA"><br />
</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;
mso-fareast-font-family:宋体;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:ZH-CN;
mso-bidi-language:AR-SA"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span lang="RU" style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;
color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">第</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">4</span><span lang="RU" style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">行：</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">D<sub>1</sub>, D<sub>2</sub>, ..., D<sub>i</sub>, ..., D<sub>n</sub></span><sub><span lang="RU" style="font-size:12.0pt;font-family:
&quot;Times New Roman&quot;;mso-fareast-font-family:宋体;color:black;background:white;
mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:
ZH-CN;mso-bidi-language:AR-SA"> </span></sub><span style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">（</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA">0&lt;=D<sub>i</sub>&lt;=N, D<sub>i</sub>&ne;i</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
宋体;color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA"> </span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;
color:black;background:white;mso-shading:windowtext;mso-pattern:solid white;
mso-ansi-language:RU;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">）</span><span lang="RU" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
&quot;Times New Roman&quot;;color:black;background:white;mso-shading:windowtext;
mso-pattern:solid white;mso-ansi-language:RU;mso-fareast-language:RU;
mso-bidi-language:AR-SA"><br style="mso-special-character:line-break" />
<br style="mso-special-character:line-break" />
</span></b></p>
<p></p></p><hr/><h3>输出格式</h3><p><p class="MsoNormal" style="margin-left:18.0pt;mso-para-margin-left:1.5gd"><b><span class="Apple-style-span" style="font-weight: normal; "><b style="mso-bidi-font-weight:normal"><span lang="RU" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;color:black;
background:white;mso-shading:windowtext;mso-pattern:solid white;mso-ansi-language:
RU;mso-fareast-language:RU;mso-bidi-language:AR-SA">一个整数，代表最大价值。</span></b></span></b></p>
<p></p></p><hr/><h3>样例输入</h3><pre>3 10
5 5 6
2 3 4
0 1 1 </pre><hr/><h3>样例输出</h3><pre>5</pre><hr/><h3>提示</h3><p>没有写明提示</p><hr/><h3>题目来源</h3><p>Day2</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=2427" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=2427" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>